//
//  FiveColumnsCategories.m
//  __PRODUCTNAME__
//
//  Created by dllo on 16/09/02
//  Copyright (c) Bin. All rights reserved.
//

#import "FiveColumnsCategories.h"
#import "FiveColumnsMagazine.h"
#import "FiveColumnsIphone.h"
#import "FiveColumnsIphone.h"
@implementation FiveColumnsCategories


- (void)setValue:(id)value forKey:(NSString *)key
{
    [super setValue:value forKey:key];
    
        
    if ([key isEqualToString:@"iphone"]) {
        NSMutableArray *fiveColumnsIphoneArr = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            FiveColumnsIphone *fiveColumnsIphone = [FiveColumnsIphone modelWithDic:dic];
            [fiveColumnsIphoneArr addObject:fiveColumnsIphone];
        }
        _iphone = fiveColumnsIphoneArr;
//        NSLog(@"3333333%@",_iphone);
    }
    else if ([key isEqualToString:@"magazine"]) {
        NSMutableArray *fiveColumnsMagazineArr = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            FiveColumnsMagazine *fiveColumnsMagazine = [FiveColumnsMagazine modelWithDic:dic];
            [fiveColumnsMagazineArr addObject:fiveColumnsMagazine];
        }
        _magazine = fiveColumnsMagazineArr;
//        NSLog(@"44444444%@",_magazine);
    }
    
}

+ (NSDictionary *)objectClassInArray{
    return @{@"magazine" : [FiveColumnsMagazine class], @"iphone" : [FiveColumnsIphone class]};
}

@end
